package com.ruoyi.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.SysMatClassificationTypeMapper;
import com.ruoyi.domain.SysMatClassificationType;
import com.ruoyi.service.ISysMatClassificationTypeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 材料分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-03
 */
@Service
public class SysMatClassificationTypeServiceImpl implements ISysMatClassificationTypeService 
{
    @Autowired
    private SysMatClassificationTypeMapper sysMatClassificationTypeMapper;


    /**
     * 查询材料分类
     * 
     * @param matClassificationId 材料分类ID
     * @return 材料分类
     */
    @Override
    public SysMatClassificationType selectSysMatClassificationTypeById(Integer matClassificationId)
    {
        return sysMatClassificationTypeMapper.selectSysMatClassificationTypeById(matClassificationId);
    }

    /**
     * 查询材料分类列表
     * 
     * @param sysMatClassificationType 材料分类
     * @return 材料分类
     */
    @Override
    public List<SysMatClassificationType> selectSysMatClassificationTypeList(SysMatClassificationType sysMatClassificationType)
    {
        return sysMatClassificationTypeMapper.selectSysMatClassificationTypeList(sysMatClassificationType);
    }

    /**
     * 新增材料分类
     * 
     * @param sysMatClassificationType 材料分类
     * @return 结果
     */
    @Override
    public int insertSysMatClassificationType(SysMatClassificationType sysMatClassificationType)
    {
        sysMatClassificationType.setMatClassificationCreateTime(new Date());
        return sysMatClassificationTypeMapper.insertSysMatClassificationType(sysMatClassificationType);
    }

    /**
     * 修改材料分类
     * 
     * @param sysMatClassificationType 材料分类
     * @return 结果
     */
    @Override
    public int updateSysMatClassificationType(SysMatClassificationType sysMatClassificationType)
    {
        sysMatClassificationType.setMatClassificationCreateTime(new Date());
        return sysMatClassificationTypeMapper.updateSysMatClassificationType(sysMatClassificationType);
    }

    /**
     * 删除材料分类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysMatClassificationTypeByIds(String ids)
    {
        return sysMatClassificationTypeMapper.deleteSysMatClassificationTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除材料分类信息
     * 
     * @param matClassificationId 材料分类ID
     * @return 结果
     */
    @Override
    public int deleteSysMatClassificationTypeById(Integer matClassificationId)
    {
        return sysMatClassificationTypeMapper.deleteSysMatClassificationTypeById(matClassificationId);
    }

    @Override
    public List<SysMatClassificationType> selectSysMatClassificationTypeLists(String matType) {
        return sysMatClassificationTypeMapper.selectSysMatClassificationTypeLists(matType);
    }

    @Override
    public String selectYC(String id) {
        return sysMatClassificationTypeMapper.selectYC(id);
    }
}
